subroutine r2abij_t1am_iijmb(r2, t1, iijka, & 
               icore, fact)
!
use mod_orbit
use mod_size
use mod_ioff
use mod_iop 
implicit none
!
real*8, intent(in) :: fact
real*4, intent(in) :: r2(*)
real*4, intent(in) :: iijka(*)
!
real*4, intent(inout) :: t1(*), icore(*)
!
integer :: i, j, a, b, nsize
integer :: i0, i1, i2, i3, i4 
integer, external :: idsymsoc
real*8, external :: dnrm2
!this is to do r2(ab,ij) = r2(abij) - Pab*t1(am)*iijka(ij,mb)
i0 = 1                 
i1 = i0 + nvvoo*isd
i2 = i1 + nvvoo*isd
i3 = i2 + nvvoo*isd  
i4 = i3 + nvvoo*isd
!====AAAA
call isymtrso(iijka(ioi2(1)), icore(i0), popa, popa, 0, 0, popa, vrta, 1, 1, 1) 
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(1)), 1, 1,popa, &
                popa, popa, 0, vrta, vrta, icore(i1), 1, 1.d0, 0.d0)
call iassymso(icore(i1), icore(i0), 1, popa, popa, vrta, vrta, 0) 
call itranspso(icore(i0), icore(i1), popa, popa, 0, vrta, vrta, 0, 1) 
call axpyso(nioi31, -fact, icore(i1), 1, r2(ioi3(1)), 1)
!====BBBB
call isymtrso(iijka(ioi2(3)), icore(i0), popb, popb, 0, 0, popb, vrtb, 1, 1, 1) 
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(2)), 1, 1,popb, &
                popb, popb, 0, vrtb, vrtb, icore(i1), 1, 1.d0, 0.d0)
call iassymso(icore(i1), icore(i0), 1, popb, popb, vrtb, vrtb, 0) 
call itranspso(icore(i0), icore(i1), popb, popb, 0, vrtb, vrtb, 0, 1) 
call axpyso(nioi33, -fact, icore(i1), 1, r2(ioi3(3)), 1)
!====ABAB
!iijka(Ij,Mb)*t1(AM)+iijka(jI,mA)*t1(bm)
call isymtrso(iijka(ioi2(2)), icore(i0), popa, popb, 1, 0, popa, vrtb, 1, 1, 1) 
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(1)), 1, 1,popa, &
                popa, popb, 1, vrtb, vrta, icore(i1), 1, 1.d0, 0.d0)
call isymtrso(icore(i1), icore(i0), popa, popb, 1, 0, vrtb, vrta, 1, 1, 1)
call itranspso(icore(i0), icore(i1), popa, popb, 1, vrta, vrtb, 1, 1) 
call axpyso(nioi32, fact, icore(i1), 1, r2(ioi3(2)), 1)
!
call isymtrso(iijka(ioi2(4)), icore(i0), popb, popa, 1, 0, popb, vrta, 1, 1, 1) 
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(2)), 1, 1,popb, &
                popb, popa, 1, vrta, vrtb, icore(i1), 1, 1.d0, 0.d0)
call isymtrso(icore(i1), icore(i0), popb, popa, 1, 1, vrtb, vrta, 1, 0, 1)
call itranspso(icore(i0), icore(i1), popa, popb, 1, vrta, vrtb, 1, 1) 
call axpyso(nioi32, fact, icore(i1), 1, r2(ioi3(2)), 1)
!
return
end
